/**
 * 
 */
package org.wolf.core.schema;

import org.apache.lucene.document.Fieldable;
import org.apache.lucene.search.SortField;

/**
 * @author 何小锋
 * 
 */
public class ByteField extends FieldType {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Override
	public void setTokenized(boolean tokenized) {
	}

	@Override
	protected SortField createSortField(DocField field, boolean reverse) {
		return new SortField(field.getName(), SortField.BYTE, reverse);
	}
	
	@Override
	public Object toExternal(Fieldable f) {
		return Byte.valueOf(f.toString());
	}

}
